<!DOCTYPE html>
<html th:replace="~{layout :: layout(~{::title}, ~{::section})}">
<head>
<title>权限编辑页面</title>

</head>
<body>
	<section>
		<link th:href="@{/zui/lib/uploader/zui.uploader.min.css}"
			rel="stylesheet">
		<form th:action="@{/admin/permission/edit}" method="post" th:object="${permission}">
			<input type="hidden" name="id" th:value="${permission?.id}">
			<div class="row">
				<div class="col-xs-2"
					style="height: 35px; display: flex; justify-content: flex-end; line-height: 35px">
					权限名称</div>
				<div class="col-xs-6">
					<input class="form-control" type="text" placeholder="请输入权限名称"
						name="code"  th:value="${permission?.code}">
				</div>
				<div class="col-xs-4" th:if="${#fields.hasErrors('code')}" th:errors="*{code}" th:style="'color:red'">


				</div>
			</div>
			<div class="row">
				<div class="col-xs-2"
					 style="height: 35px; display: flex; justify-content: flex-end; line-height: 35px">
					权限路径</div>
				<div class="col-xs-6">
					<input class="form-control" type="text" placeholder="请输入权限的路径"
						   name="url"  th:value="${permission?.url}">
				</div>
				<div class="col-xs-4" th:if="${#fields.hasErrors('url')}" th:errors="*{url}" th:style="'color:red'">


				</div>
			</div>
			<div class="row">
				<div class="col-xs-2"
					 style="height: 35px; display: flex; justify-content: flex-end; line-height: 35px">
					权限类型</div>
				<div class="col-xs-6">
					<select class="form-control" name="type" th:value="${permission?.type}">
						<option th:selected="${permission.type eq '路径权限'}" value="路径权限" >路径权限</option>
						<option th:selected="${permission.type eq '按钮权限'}" value="按钮权限">按钮权限</option>
					</select>
				</div>
				<div class="col-xs-4"></div>
			</div>
			<div class="row">
				<div class="col-xs-2"
					 style="height: 35px; display: flex; justify-content: flex-end; line-height: 35px">
					权限介绍</div>
				<div class="col-xs-6">
					<textarea id="decription" name="description" placeholder="请输入介绍"
							  class="form-control" th:text="${permission?.description}"></textarea>
				</div>
				<div class="col-xs-4" th:if="${#fields.hasErrors('type')}" th:errors="*{type}" th:style="'color:red'"></div>
			</div>
			<div class="row">
				<div class="col-xs-2"
					style="height: 35px; display: flex; justify-content: flex-end; line-height: 35px">
					</div>
				<div class="col-xs-6">
					<button class="btn btn-primary btn-block" type="submit">保存</button>
				</div>
				<div class="col-xs-4"></div>
			</div>

		</form>
	</section>
</body>
</html>